//
// Created by 13562 on 2023/6/23.
//

#include "windows.h"
#include "CLevelingAdjust.h"
#include "iomanip"

int main() {
	SetConsoleOutputCP(CP_UTF8);
	CLevelingAdjust cla;
	string knFile, obsFile;
	cout << "已知点文件: ";
	cin >> knFile;
	cout << "观测数据文件: ";
	cin >> obsFile;
	cla.inputData(knFile, obsFile);
	cla.calcApproxHeight();
	cla.adjust();

	char drive[_MAX_DRIVE];
	char dir[_MAX_PATH];
	char fname[_MAX_FNAME];
	char ext[_MAX_EXT];
	string sDrive, sDir, sFilename, sSuffix;
	_splitpath(obsFile.c_str(), drive, dir, fname, ext);
	sDrive = drive, sDir = dir, sFilename = fname, sSuffix = ext;
	string reportFile = sDrive + sDir + "adjustment_report" + sSuffix;

	cla.report(reportFile);
}